package utils;

import java.awt.Component;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

import org.w3c.dom.DOMException;

import components.MyPanel;

public class PanelFactory {
	public static MyPanel makePanel(String s){
		MyPanel tmp=null;
		try {
			Class tmpClass=Class.forName("ui."+s+"Panel");
			Class[] argsClass = {};                                   	 
			Constructor cons = tmpClass.getConstructor(argsClass);	
			tmp = (MyPanel) cons.newInstance();
		} catch (InstantiationException | IllegalAccessException
				| ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalArgumentException | InvocationTargetException | DOMException e) {
			e.printStackTrace();
		}
		return tmp;
	}

}
